package com.nbsaas.boot.pms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "项目成员", model = "项目成员")
@Entity
@Table(name = "bs_pms_project_member")
@Comment("项目成员表")
public class ProjectMember extends AbstractEntity {

    @Comment("项目ID")
    @FormField(title = "项目", sortNum = "1", grid = true, type = InputType.select)
    private Long projectId;

    @Comment("用户ID")
    @FormField(title = "用户", sortNum = "2", grid = true, type = InputType.select)
    private Long userId;

    @Comment("角色")
    @FormField(title = "角色", sortNum = "3", grid = true, type = InputType.select)
    @Column(length = 20)
    private String role; // PROJECT_MANAGER-项目经理, DEVELOPER-开发人员, TESTER-测试人员, DESIGNER-设计师, ANALYST-分析师, VIEWER-观察者

    @Comment("权限级别")
    @FormField(title = "权限级别", sortNum = "4", grid = true, type = InputType.select)
    @Column(length = 20)
    private String permissionLevel; // READ-只读, WRITE-读写, ADMIN-管理员

    @Comment("加入时间")
    @FormField(title = "加入时间", sortNum = "5", type = InputType.date, grid = true)
    private Date joinDate;

    @Comment("离开时间")
    @FormField(title = "离开时间", sortNum = "6", type = InputType.date, grid = true)
    private Date leaveDate;

    @Comment("是否活跃")
    @FormField(title = "是否活跃", sortNum = "7", grid = true, type = InputType.select)
    private Boolean active;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "8", type = InputType.textarea, col = 23)
    @Column(columnDefinition = "TEXT")
    private String remarks;
} 